<template>
  <div class="wrap">
    <div class="center" v-if="userInfo">
      <div class="title">
        <img :src="userInfo.avatar" class="avi" alt />
        <p>{{userInfo.username}}</p>
      </div>
      <img :src="userInfo.qr_code" class="code" alt />
      <span>扫描图中二维码关注我</span>
      <div class="fl">
        <span>保存二维码</span>
        <img class="ll" src="../assets/save.png" alt="">
      </div>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.wrap {
  height: 100vh;
  background: #fcf9fc;
  overflow: hidden;
}
.center {
  width: 9.173333rem;
  height: 12.8rem;
  background: #fff;
  border-radius: 0.266667rem;
  margin: 40px auto;
  overflow: hidden;
  .title {
    display: flex;
    align-items: center;
    margin-left: .5rem;
    margin-top: 1.04rem;
    .avi {
      width: 1.173333rem;
      height: 1.173333rem;
      border-radius: 50%;
      background: #000;
      display: block;
    }
    p {
      color: #555;
      font-size: 0.453333rem;
      margin-left: 0.266667rem;
    }
  }
  .code {
    width: 8rem;
    height: 8rem;
    background: #000;
    display: block;
    margin: 0.4rem auto;
    border-radius: 0.266667rem;
  }
  span {
    color: #999;
    font-size: 0.32rem;
    display: block;
    width: 8rem;
    margin: 0 auto 8px;
    text-align: left;
  }
  .fl{
      border-top: .5px solid #e5e5e5;
      display: flex;
      align-items: center;
      width: 8rem;
      padding-top: 8px;
      margin: 0 auto;
      justify-content: flex-start;
      .ll{
          display: .4rem;
          height: .4rem;
          display: block;
          margin-left: 15px;
         
      }
      >span{
          margin: 0;
          width: auto;
      }
  }
}
</style>
<script>
import {getById} from '@/utils/interface'
export default {
  data(){
    return {
      userInfo:""
    }
  },
  mounted(){
    getById({openid:localStorage.getItem('wechataccess_user_token')}).then(res=>{
      console.log(res.data)
      this.userInfo = res.data.data
    })
  }
}
</script>

